"""
使用其他属性定位：class name...
根据层级关系
根据部分元素属性XPath
    contains(a,b):如果a包含b，返回true
    starts_with(a,b):如果a以b开头，返回true
    ends_with(a,b):如果a以b结尾，返回true
"""

from selenium import webdriver
from selenium.webdriver.common.by import By
import time

wd = webdriver.Chrome()
wd.maximize_window()
wd.get("https://www.126.com/")
wd.switch_to.frame(0)
# wd.find_element(By.XPATH, '//input[contains(@id,"auto-id-")]').send_keys("111")
wd.find_element(By.XPATH, '//input[starts-with(@id,"auto-id-")]').send_keys(222)
time.sleep(2)